import '../../../../core/errors/failure.dart';
import '../../../../core/network/api_client.dart';
import '../entity/home_bean.dart';

class HomeRepositoryImpl {
  final ApiClient apiClient;

  HomeRepositoryImpl(this.apiClient);

  Future<HomeBean> getDataForNet() async {
    final response = await apiClient.get('/xiaohuanger/update.json');
    if (response.statusCode == 200) {
      return HomeBean.fromJson(response.data);
    } else {
      throw ServerFailure('getDataForNet failed');
    }
  }
}
